home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue41 / ComCorn / LVCtrl_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-12-02  |  28.3 KB  |  685 lines

  1. unit LVCtrl_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                  //
  5. // -------                                                                  //
  6. // The types declared in this file were generated from data read from a     //
  7. // Type Library. If this type library is explicitly or indirectly (via      //
  8. // another type library referring to this type library) re-imported, or the //
  9. // 'Refresh' command of the Type Library Editor activated while editing the //
  10. // Type Library, the contents of this file will be regenerated and all      //
  11. // manual modifications will be lost.                                       //
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.11.1.75  $
  15. // File generated on 12/2/98 4:05:41 PM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: C:\My Documents\DelphiMag, Jan99\LVCtrl\LVCtrl.tlb
  19. // IID\LCID: {2C998C80-8899-11D2-9261-00104B700B61}\0
  20. // Helpfile: 
  21. // HelpString: LVCtrl Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_LVCtrl: TGUID = '{2C998C80-8899-11D2-9261-00104B700B61}';
  38.   IID_IListViewX: TGUID = '{2C998C81-8899-11D2-9261-00104B700B61}';
  39.   DIID_IListViewXEvents: TGUID = '{2C998C83-8899-11D2-9261-00104B700B61}';
  40.   CLASS_ListViewX: TGUID = '{2C998C85-8899-11D2-9261-00104B700B61}';
  41.   IID_IListItem: TGUID = '{1B5911E1-88A1-11D2-9261-00104B700B61}';
  42.   CLASS_ListItem: TGUID = '{1B5911E3-88A1-11D2-9261-00104B700B61}';
  43.   IID_IListItems: TGUID = '{C6B36444-88B1-11D2-9261-00104B700B61}';
  44.   CLASS_ListItems: TGUID = '{C6B36446-88B1-11D2-9261-00104B700B61}';
  45.  
  46. // *********************************************************************//
  47. // Declaration of Enumerations defined in Type Library                  //
  48. // *********************************************************************//
  49. // TxBiDiMode constants
  50. type
  51.   TxBiDiMode = TOleEnum;
  52. const
  53.   bdLeftToRight = $00000000;
  54.   bdRightToLeft = $00000001;
  55.   bdRightToLeftNoAlign = $00000002;
  56.   bdRightToLeftReadingOnly = $00000003;
  57.  
  58. // TxBorderStyle constants
  59. type
  60.   TxBorderStyle = TOleEnum;
  61. const
  62.   bsNone = $00000000;
  63.   bsSingle = $00000001;
  64.  
  65. // TxDragMode constants
  66. type
  67.   TxDragMode = TOleEnum;
  68. const
  69.   dmManual = $00000000;
  70.   dmAutomatic = $00000001;
  71.  
  72. // TxSortType constants
  73. type
  74.   TxSortType = TOleEnum;
  75. const
  76.   stNone = $00000000;
  77.   stData = $00000001;
  78.   stText = $00000002;
  79.   stBoth = $00000003;
  80.  
  81. // TxViewStyle constants
  82. type
  83.   TxViewStyle = TOleEnum;
  84. const
  85.   vsIcon = $00000000;
  86.   vsSmallIcon = $00000001;
  87.   vsList = $00000002;
  88.   vsReport = $00000003;
  89.  
  90. // TxItemFind constants
  91. type
  92.   TxItemFind = TOleEnum;
  93. const
  94.   ifData = $00000000;
  95.   ifPartialString = $00000001;
  96.   ifExactString = $00000002;
  97.   ifNearest = $00000003;
  98.  
  99. // TxMouseButton constants
  100. type
  101.   TxMouseButton = TOleEnum;
  102. const
  103.   mbLeft = $00000000;
  104.   mbRight = $00000001;
  105.   mbMiddle = $00000002;
  106.  
  107. // TxListArrangement constants
  108. type
  109.   TxListArrangement = TOleEnum;
  110. const
  111.   arAlignBottom = $00000000;
  112.   arAlignLeft = $00000001;
  113.   arAlignRight = $00000002;
  114.   arAlignTop = $00000003;
  115.   arDefault = $00000004;
  116.   arSnapToGrid = $00000005;
  117.  
  118. // TxAlignment constants
  119. type
  120.   TxAlignment = TOleEnum;
  121. const
  122.   taLeftJustify = $00000000;
  123.   taRightJustify = $00000001;
  124.   taCenter = $00000002;
  125.  
  126. type
  127.  
  128. // *********************************************************************//
  129. // Forward declaration of interfaces defined in Type Library            //
  130. // *********************************************************************//
  131.   IListViewX = interface;
  132.   IListViewXDisp = dispinterface;
  133.   IListViewXEvents = dispinterface;
  134.   IListItem = interface;
  135.   IListItemDisp = dispinterface;
  136.   IListItems = interface;
  137.   IListItemsDisp = dispinterface;
  138.  
  139. // *********************************************************************//
  140. // Declaration of CoClasses defined in Type Library                     //
  141. // (NOTE: Here we map each CoClass to its Default Interface)            //
  142. // *********************************************************************//
  143.   ListViewX = IListViewX;
  144.   ListItem = IListItem;
  145.   ListItems = IListItems;
  146.  
  147.  
  148. // *********************************************************************//
  149. // Declaration of structures, unions and aliases.                       //
  150. // *********************************************************************//
  151.   POleVar = ^OleVariant; 
  152.  
  153.  
  154. // *********************************************************************//
  155. // Interface: IListViewX
  156. // Flags:     (4416) Dual OleAutomation Dispatchable
  157. // GUID:      {2C998C81-8899-11D2-9261-00104B700B61}
  158. // *********************************************************************//
  159.   IListViewX = interface(IDispatch)
  160.     ['{2C998C81-8899-11D2-9261-00104B700B61}']
  161.     function Get_AllocBy: Integer; safecall;
  162.     procedure Set_AllocBy(Value: Integer); safecall;
  163.     function Get_BiDiMode: TxBiDiMode; safecall;
  164.     procedure Set_BiDiMode(Value: TxBiDiMode); safecall;
  165.     function Get_BorderStyle: TxBorderStyle; safecall;
  166.     procedure Set_BorderStyle(Value: TxBorderStyle); safecall;
  167.     function Get_Checkboxes: WordBool; safecall;
  168.     procedure Set_Checkboxes(Value: WordBool); safecall;
  169.     function Get_Color: OLE_COLOR; safecall;
  170.     procedure Set_Color(Value: OLE_COLOR); safecall;
  171.     function Get_ColumnClick: WordBool; safecall;
  172.     procedure Set_ColumnClick(Value: WordBool); safecall;
  173.     function Get_Ctl3D: WordBool; safecall;
  174.     procedure Set_Ctl3D(Value: WordBool); safecall;
  175.     function Get_DragCursor: Smallint; safecall;
  176.     procedure Set_DragCursor(Value: Smallint); safecall;
  177.     function Get_DragMode: TxDragMode; safecall;
  178.     procedure Set_DragMode(Value: TxDragMode); safecall;
  179.     function Get_Enabled: WordBool; safecall;
  180.     procedure Set_Enabled(Value: WordBool); safecall;
  181.     function Get_Font: IFontDisp; safecall;
  182.     procedure _Set_Font(const Value: IFontDisp); safecall;
  183.     procedure Set_Font(var Value: IFontDisp); safecall;
  184.     function Get_FlatScrollBars: WordBool; safecall;
  185.     procedure Set_FlatScrollBars(Value: WordBool); safecall;
  186.     function Get_FullDrag: WordBool; safecall;
  187.     procedure Set_FullDrag(Value: WordBool); safecall;
  188.     function Get_GridLines: WordBool; safecall;
  189.     procedure Set_GridLines(Value: WordBool); safecall;
  190.     function Get_HideSelection: WordBool; safecall;
  191.     procedure Set_HideSelection(Value: WordBool); safecall;
  192.     function Get_HotTrack: WordBool; safecall;
  193.     procedure Set_HotTrack(Value: WordBool); safecall;
  194.     function Get_MultiSelect: WordBool; safecall;
  195.     procedure Set_MultiSelect(Value: WordBool); safecall;
  196.     function Get_OwnerData: WordBool; safecall;
  197.     procedure Set_OwnerData(Value: WordBool); safecall;
  198.     function Get_OwnerDraw: WordBool; safecall;
  199.     procedure Set_OwnerDraw(Value: WordBool); safecall;
  200.     function Get_ReadOnly: WordBool; safecall;
  201.     procedure Set_ReadOnly(Value: WordBool); safecall;
  202.     function Get_RowSelect: WordBool; safecall;
  203.     procedure Set_RowSelect(Value: WordBool); safecall;
  204.     function Get_ParentColor: WordBool; safecall;
  205.     procedure Set_ParentColor(Value: WordBool); safecall;
  206.     function Get_ParentFont: WordBool; safecall;
  207.     procedure Set_ParentFont(Value: WordBool); safecall;
  208.     function Get_ShowColumnHeaders: WordBool; safecall;
  209.     procedure Set_ShowColumnHeaders(Value: WordBool); safecall;
  210.     function Get_SortType: TxSortType; safecall;
  211.     procedure Set_SortType(Value: TxSortType); safecall;
  212.     function Get_ViewStyle: TxViewStyle; safecall;
  213.     procedure Set_ViewStyle(Value: TxViewStyle); safecall;
  214.     function Get_Visible: WordBool; safecall;
  215.     procedure Set_Visible(Value: WordBool); safecall;
  216.     function AlphaSort: WordBool; safecall;
  217.     procedure Arrange(Code: TxListArrangement); safecall;
  218.     function GetSearchString: WideString; safecall;
  219.     function IsEditing: WordBool; safecall;
  220.     procedure Scroll(DX: Integer; DY: Integer); safecall;
  221.     function Get_SelCount: Integer; safecall;
  222.     function StringWidth(const S: WideString): Integer; safecall;
  223.     procedure UpdateItems(FirstIndex: Integer; LastIndex: Integer); safecall;
  224.     function Get_VisibleRowCount: Integer; safecall;
  225.     function Get_DoubleBuffered: WordBool; safecall;
  226.     procedure Set_DoubleBuffered(Value: WordBool); safecall;
  227.     procedure FlipChildren(AllLevels: WordBool); safecall;
  228.     function DrawTextBiDiModeFlags(Flags: Integer): Integer; safecall;
  229.     function DrawTextBiDiModeFlagsReadingOnly: Integer; safecall;
  230.     function GetControlsAlignment: TxAlignment; safecall;
  231.     procedure InitiateAction; safecall;
  232.     function IsRightToLeft: WordBool; safecall;
  233.     function UseRightToLeftAlignment: WordBool; safecall;
  234.     function UseRightToLeftReading: WordBool; safecall;
  235.     function UseRightToLeftScrollBar: WordBool; safecall;
  236.     function Get_Cursor: Smallint; safecall;
  237.     procedure Set_Cursor(Value: Smallint); safecall;
  238.     function ClassNameIs(const Name: WideString): WordBool; safecall;
  239.     procedure AboutBox; safecall;
  240.     function Get_Items: IListItems; safecall;
  241.     property AllocBy: Integer read Get_AllocBy write Set_AllocBy;
  242.     property BiDiMode: TxBiDiMode read Get_BiDiMode write Set_BiDiMode;
  243.     property BorderStyle: TxBorderStyle read Get_BorderStyle write Set_BorderStyle;
  244.     property Checkboxes: WordBool read Get_Checkboxes write Set_Checkboxes;
  245.     property Color: OLE_COLOR read Get_Color write Set_Color;
  246.     property ColumnClick: WordBool read Get_ColumnClick write Set_ColumnClick;
  247.     property Ctl3D: WordBool read Get_Ctl3D write Set_Ctl3D;
  248.     property DragCursor: Smallint read Get_DragCursor write Set_DragCursor;
  249.     property DragMode: TxDragMode read Get_DragMode write Set_DragMode;
  250.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  251.     property Font: IFontDisp read Get_Font write _Set_Font;
  252.     property FlatScrollBars: WordBool read Get_FlatScrollBars write Set_FlatScrollBars;
  253.     property FullDrag: WordBool read Get_FullDrag write Set_FullDrag;
  254.     property GridLines: WordBool read Get_GridLines write Set_GridLines;
  255.     property HideSelection: WordBool read Get_HideSelection write Set_HideSelection;
  256.     property HotTrack: WordBool read Get_HotTrack write Set_HotTrack;
  257.     property MultiSelect: WordBool read Get_MultiSelect write Set_MultiSelect;
  258.     property OwnerData: WordBool read Get_OwnerData write Set_OwnerData;
  259.     property OwnerDraw: WordBool read Get_OwnerDraw write Set_OwnerDraw;
  260.     property ReadOnly: WordBool read Get_ReadOnly write Set_ReadOnly;
  261.     property RowSelect: WordBool read Get_RowSelect write Set_RowSelect;
  262.     property ParentColor: WordBool read Get_ParentColor write Set_ParentColor;
  263.     property ParentFont: WordBool read Get_ParentFont write Set_ParentFont;
  264.     property ShowColumnHeaders: WordBool read Get_ShowColumnHeaders write Set_ShowColumnHeaders;
  265.     property SortType: TxSortType read Get_SortType write Set_SortType;
  266.     property ViewStyle: TxViewStyle read Get_ViewStyle write Set_ViewStyle;
  267.     property Visible: WordBool read Get_Visible write Set_Visible;
  268.     property SelCount: Integer read Get_SelCount;
  269.     property VisibleRowCount: Integer read Get_VisibleRowCount;
  270.     property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
  271.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  272.     property Items: IListItems read Get_Items;
  273.   end;
  274.  
  275. // *********************************************************************//
  276. // DispIntf:  IListViewXDisp
  277. // Flags:     (4416) Dual OleAutomation Dispatchable
  278. // GUID:      {2C998C81-8899-11D2-9261-00104B700B61}
  279. // *********************************************************************//
  280.   IListViewXDisp = dispinterface
  281.     ['{2C998C81-8899-11D2-9261-00104B700B61}']
  282.     property AllocBy: Integer dispid 1;
  283.     property BiDiMode: TxBiDiMode dispid 2;
  284.     property BorderStyle: TxBorderStyle dispid 3;
  285.     property Checkboxes: WordBool dispid 4;
  286.     property Color: OLE_COLOR dispid -501;
  287.     property ColumnClick: WordBool dispid 5;
  288.     property Ctl3D: WordBool dispid 6;
  289.     property DragCursor: Smallint dispid 7;
  290.     property DragMode: TxDragMode dispid 8;
  291.     property Enabled: WordBool dispid -514;
  292.     property Font: IFontDisp dispid -512;
  293.     property FlatScrollBars: WordBool dispid 9;
  294.     property FullDrag: WordBool dispid 10;
  295.     property GridLines: WordBool dispid 11;
  296.     property HideSelection: WordBool dispid 12;
  297.     property HotTrack: WordBool dispid 13;
  298.     property MultiSelect: WordBool dispid 14;
  299.     property OwnerData: WordBool dispid 15;
  300.     property OwnerDraw: WordBool dispid 16;
  301.     property ReadOnly: WordBool dispid 17;
  302.     property RowSelect: WordBool dispid 18;
  303.     property ParentColor: WordBool dispid 19;
  304.     property ParentFont: WordBool dispid 20;
  305.     property ShowColumnHeaders: WordBool dispid 21;
  306.     property SortType: TxSortType dispid 22;
  307.     property ViewStyle: TxViewStyle dispid 23;
  308.     property Visible: WordBool dispid 24;
  309.     function AlphaSort: WordBool; dispid 25;
  310.     procedure Arrange(Code: TxListArrangement); dispid 26;
  311.     function GetSearchString: WideString; dispid 27;
  312.     function IsEditing: WordBool; dispid 28;
  313.     procedure Scroll(DX: Integer; DY: Integer); dispid 29;
  314.     property SelCount: Integer readonly dispid 30;
  315.     function StringWidth(const S: WideString): Integer; dispid 32;
  316.     procedure UpdateItems(FirstIndex: Integer; LastIndex: Integer); dispid 33;
  317.     property VisibleRowCount: Integer readonly dispid 34;
  318.     property DoubleBuffered: WordBool dispid 37;
  319.     procedure FlipChildren(AllLevels: WordBool); dispid 38;
  320.     function DrawTextBiDiModeFlags(Flags: Integer): Integer; dispid 41;
  321.     function DrawTextBiDiModeFlagsReadingOnly: Integer; dispid 42;
  322.     function GetControlsAlignment: TxAlignment; dispid 43;
  323.     procedure InitiateAction; dispid 45;
  324.     function IsRightToLeft: WordBool; dispid 46;
  325.     function UseRightToLeftAlignment: WordBool; dispid 51;
  326.     function UseRightToLeftReading: WordBool; dispid 52;
  327.     function UseRightToLeftScrollBar: WordBool; dispid 53;
  328.     property Cursor: Smallint dispid 54;
  329.     function ClassNameIs(const Name: WideString): WordBool; dispid 58;
  330.     procedure AboutBox; dispid -552;
  331.     property Items: IListItems readonly dispid 31;
  332.   end;
  333.  
  334. // *********************************************************************//
  335. // DispIntf:  IListViewXEvents
  336. // Flags:     (4096) Dispatchable
  337. // GUID:      {2C998C83-8899-11D2-9261-00104B700B61}
  338. // *********************************************************************//
  339.   IListViewXEvents = dispinterface
  340.     ['{2C998C83-8899-11D2-9261-00104B700B61}']
  341.     procedure OnClick; dispid 3;
  342.     procedure OnDataHint(StartIndex: Integer; EndIndex: Integer); dispid 11;
  343.     procedure OnDblClick; dispid 13;
  344.     procedure OnKeyPress(var Key: Smallint); dispid 25;
  345.     procedure OnResize; dispid 30;
  346.   end;
  347.  
  348. // *********************************************************************//
  349. // Interface: IListItem
  350. // Flags:     (4416) Dual OleAutomation Dispatchable
  351. // GUID:      {1B5911E1-88A1-11D2-9261-00104B700B61}
  352. // *********************************************************************//
  353.   IListItem = interface(IDispatch)
  354.     ['{1B5911E1-88A1-11D2-9261-00104B700B61}']
  355.     function Get_Caption: WideString; safecall;
  356.     procedure Set_Caption(const Value: WideString); safecall;
  357.     function Get_Index: Integer; safecall;
  358.     function Get_Checked: WordBool; safecall;
  359.     procedure Set_Checked(Value: WordBool); safecall;
  360.     function Get_SubItems: IStrings; safecall;
  361.     procedure Set_SubItems(const Value: IStrings); safecall;
  362.     property Caption: WideString read Get_Caption write Set_Caption;
  363.     property Index: Integer read Get_Index;
  364.     property Checked: WordBool read Get_Checked write Set_Checked;
  365.     property SubItems: IStrings read Get_SubItems write Set_SubItems;
  366.   end;
  367.  
  368. // *********************************************************************//
  369. // DispIntf:  IListItemDisp
  370. // Flags:     (4416) Dual OleAutomation Dispatchable
  371. // GUID:      {1B5911E1-88A1-11D2-9261-00104B700B61}
  372. // *********************************************************************//
  373.   IListItemDisp = dispinterface
  374.     ['{1B5911E1-88A1-11D2-9261-00104B700B61}']
  375.     property Caption: WideString dispid 1;
  376.     property Index: Integer readonly dispid 2;
  377.     property Checked: WordBool dispid 3;
  378.     property SubItems: IStrings dispid 4;
  379.   end;
  380.  
  381. // *********************************************************************//
  382. // Interface: IListItems
  383. // Flags:     (4416) Dual OleAutomation Dispatchable
  384. // GUID:      {C6B36444-88B1-11D2-9261-00104B700B61}
  385. // *********************************************************************//
  386.   IListItems = interface(IDispatch)
  387.     ['{C6B36444-88B1-11D2-9261-00104B700B61}']
  388.     function Get__NewEnum: IUnknown; safecall;
  389.     function Get_Item(Index: Integer): IListItem; safecall;
  390.     function Get_Count: Integer; safecall;
  391.     function Add: IListItem; safecall;
  392.     procedure Remove(Index: Integer); safecall;
  393.     property _NewEnum: IUnknown read Get__NewEnum;
  394.     property Item[Index: Integer]: IListItem read Get_Item; default;
  395.     property Count: Integer read Get_Count;
  396.   end;
  397.  
  398. // *********************************************************************//
  399. // DispIntf:  IListItemsDisp
  400. // Flags:     (4416) Dual OleAutomation Dispatchable
  401. // GUID:      {C6B36444-88B1-11D2-9261-00104B700B61}
  402. // *********************************************************************//
  403.   IListItemsDisp = dispinterface
  404.     ['{C6B36444-88B1-11D2-9261-00104B700B61}']
  405.     property _NewEnum: IUnknown readonly dispid -4;
  406.     property Item[Index: Integer]: IListItem readonly dispid 0; default;
  407.     property Count: Integer readonly dispid 1;
  408.     function Add: IListItem; dispid 2;
  409.     procedure Remove(Index: Integer); dispid 3;
  410.   end;
  411.  
  412.  
  413. // *********************************************************************//
  414. // OLE Control Proxy class declaration
  415. // Control Name     : TListViewX
  416. // Help String      : ListViewX Control
  417. // Default Interface: IListViewX
  418. // Def. Intf. DISP? : No
  419. // Event   Interface: IListViewXEvents
  420. // TypeFlags        : (34) CanCreate Control
  421. // *********************************************************************//
  422.   TListViewXOnDataHint = procedure(Sender: TObject; StartIndex: Integer; EndIndex: Integer) of object;
  423.   TListViewXOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  424.  
  425.   TListViewX = class(TOleControl)
  426.   private
  427.     FIListViewXEvents_OnClick: TNotifyEvent;
  428.     FOnDataHint: TListViewXOnDataHint;
  429.     FIListViewXEvents_OnDblClick: TNotifyEvent;
  430.     FIListViewXEvents_OnKeyPress: TListViewXOnKeyPress;
  431.     FOnResize: TNotifyEvent;
  432.     FIntf: IListViewX;
  433.     function  GetControlInterface: IListViewX;
  434.     function Get_Items: IListItems;
  435.   protected
  436.     procedure CreateControl;
  437.     procedure InitControlData; override;
  438.   public
  439.     function AlphaSort: WordBool;
  440.     procedure Arrange(Code: TxListArrangement);
  441.     function GetSearchString: WideString;
  442.     function IsEditing: WordBool;
  443.     procedure Scroll(DX: Integer; DY: Integer);
  444.     function StringWidth(const S: WideString): Integer;
  445.     procedure UpdateItems(FirstIndex: Integer; LastIndex: Integer);
  446.     procedure FlipChildren(AllLevels: WordBool);
  447.     function DrawTextBiDiModeFlags(Flags: Integer): Integer;
  448.     function DrawTextBiDiModeFlagsReadingOnly: Integer;
  449.     function GetControlsAlignment: TxAlignment;
  450.     procedure InitiateAction;
  451.     function IsRightToLeft: WordBool;
  452.     function UseRightToLeftAlignment: WordBool;
  453.     function UseRightToLeftReading: WordBool;
  454.     function UseRightToLeftScrollBar: WordBool;
  455.     function ClassNameIs(const Name: WideString): WordBool;
  456.     procedure AboutBox;
  457.     property  ControlInterface: IListViewX read GetControlInterface;
  458.     property SelCount: Integer index 30 read GetIntegerProp;
  459.     property VisibleRowCount: Integer index 34 read GetIntegerProp;
  460.     property DoubleBuffered: WordBool index 37 read GetWordBoolProp write SetWordBoolProp;
  461.     property Items: IListItems read Get_Items;
  462.   published
  463.     property  TabStop;
  464.     property  Align;
  465.     property  ParentShowHint;
  466.     property  PopupMenu;
  467.     property  ShowHint;
  468.     property  TabOrder;
  469.     property  OnDragDrop;
  470.     property  OnDragOver;
  471.     property  OnEndDrag;
  472.     property  OnEnter;
  473.     property  OnExit;
  474.     property  OnStartDrag;
  475.     property AllocBy: Integer index 1 read GetIntegerProp write SetIntegerProp stored False;
  476.     property BiDiMode: TOleEnum index 2 read GetTOleEnumProp write SetTOleEnumProp stored False;
  477.     property BorderStyle: TOleEnum index 3 read GetTOleEnumProp write SetTOleEnumProp stored False;
  478.     property Checkboxes: WordBool index 4 read GetWordBoolProp write SetWordBoolProp stored False;
  479.     property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
  480.     property ColumnClick: WordBool index 5 read GetWordBoolProp write SetWordBoolProp stored False;
  481.     property Ctl3D: WordBool index 6 read GetWordBoolProp write SetWordBoolProp stored False;
  482.     property DragCursor: Smallint index 7 read GetSmallintProp write SetSmallintProp stored False;
  483.     property DragMode: TOleEnum index 8 read GetTOleEnumProp write SetTOleEnumProp stored False;
  484.     property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp stored False;
  485.     property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
  486.     property FlatScrollBars: WordBool index 9 read GetWordBoolProp write SetWordBoolProp stored False;
  487.     property FullDrag: WordBool index 10 read GetWordBoolProp write SetWordBoolProp stored False;
  488.     property GridLines: WordBool index 11 read GetWordBoolProp write SetWordBoolProp stored False;
  489.     property HideSelection: WordBool index 12 read GetWordBoolProp write SetWordBoolProp stored False;
  490.     property HotTrack: WordBool index 13 read GetWordBoolProp write SetWordBoolProp stored False;
  491.     property MultiSelect: WordBool index 14 read GetWordBoolProp write SetWordBoolProp stored False;
  492.     property OwnerData: WordBool index 15 read GetWordBoolProp write SetWordBoolProp stored False;
  493.     property OwnerDraw: WordBool index 16 read GetWordBoolProp write SetWordBoolProp stored False;
  494.     property ReadOnly: WordBool index 17 read GetWordBoolProp write SetWordBoolProp stored False;
  495.     property RowSelect: WordBool index 18 read GetWordBoolProp write SetWordBoolProp stored False;
  496.     property ParentColor: WordBool index 19 read GetWordBoolProp write SetWordBoolProp stored False;
  497.     property ParentFont: WordBool index 20 read GetWordBoolProp write SetWordBoolProp stored False;
  498.     property ShowColumnHeaders: WordBool index 21 read GetWordBoolProp write SetWordBoolProp stored False;
  499.     property SortType: TOleEnum index 22 read GetTOleEnumProp write SetTOleEnumProp stored False;
  500.     property ViewStyle: TOleEnum index 23 read GetTOleEnumProp write SetTOleEnumProp stored False;
  501.     property Visible: WordBool index 24 read GetWordBoolProp write SetWordBoolProp stored False;
  502.     property Cursor: Smallint index 54 read GetSmallintProp write SetSmallintProp stored False;
  503.     property IListViewXEvents_OnClick: TNotifyEvent read FIListViewXEvents_OnClick write FIListViewXEvents_OnClick;
  504.     property OnDataHint: TListViewXOnDataHint read FOnDataHint write FOnDataHint;
  505.     property IListViewXEvents_OnDblClick: TNotifyEvent read FIListViewXEvents_OnDblClick write FIListViewXEvents_OnDblClick;
  506.     property IListViewXEvents_OnKeyPress: TListViewXOnKeyPress read FIListViewXEvents_OnKeyPress write FIListViewXEvents_OnKeyPress;
  507.     property OnResize: TNotifyEvent read FOnResize write FOnResize;
  508.   end;
  509.  
  510.   CoListItem = class
  511.     class function Create: IListItem;
  512.     class function CreateRemote(const MachineName: string): IListItem;
  513.   end;
  514.  
  515.   CoListItems = class
  516.     class function Create: IListItems;
  517.     class function CreateRemote(const MachineName: string): IListItems;
  518.   end;
  519.  
  520. procedure Register;
  521.  
  522. implementation
  523.  
  524. uses ComObj;
  525.  
  526. procedure TListViewX.InitControlData;
  527. const
  528.   CEventDispIDs: array [0..4] of DWORD = (
  529.     $00000003, $0000000B, $0000000D, $00000019, $0000001E);
  530.   CTFontIDs: array [0..0] of DWORD = (
  531.     $FFFFFE00);
  532.   CControlData: TControlData2 = (
  533.     ClassID: '{2C998C85-8899-11D2-9261-00104B700B61}';
  534.     EventIID: '{2C998C83-8899-11D2-9261-00104B700B61}';
  535.     EventCount: 5;
  536.     EventDispIDs: @CEventDispIDs;
  537.     LicenseKey: nil;
  538.     Flags: $0000000D;
  539.     Version: 401;
  540.     FontCount: 1;
  541.     FontIDs: @CTFontIDs);
  542. begin
  543.   ControlData := @CControlData;
  544.   TControlData2(CControlData).FirstEventOfs := Cardinal(@@FIListViewXEvents_OnClick) - Cardinal(Self);
  545. end;
  546.  
  547. procedure TListViewX.CreateControl;
  548.  
  549.   procedure DoCreate;
  550.   begin
  551.     FIntf := IUnknown(OleObject) as IListViewX;
  552.   end;
  553.  
  554. begin
  555.   if FIntf = nil then DoCreate;
  556. end;
  557.  
  558. function TListViewX.GetControlInterface: IListViewX;
  559. begin
  560.   CreateControl;
  561.   Result := FIntf;
  562. end;
  563.  
  564. function TListViewX.Get_Items: IListItems;
  565. begin
  566.   Result := ControlInterface.Get_Items;
  567. end;
  568.  
  569. function TListViewX.AlphaSort: WordBool;
  570. begin
  571.   Result := ControlInterface.AlphaSort;
  572. end;
  573.  
  574. procedure TListViewX.Arrange(Code: TxListArrangement);
  575. begin
  576.   ControlInterface.Arrange(Code);
  577. end;
  578.  
  579. function TListViewX.GetSearchString: WideString;
  580. begin
  581.   Result := ControlInterface.GetSearchString;
  582. end;
  583.  
  584. function TListViewX.IsEditing: WordBool;
  585. begin
  586.   Result := ControlInterface.IsEditing;
  587. end;
  588.  
  589. procedure TListViewX.Scroll(DX: Integer; DY: Integer);
  590. begin
  591.   ControlInterface.Scroll(DX, DY);
  592. end;
  593.  
  594. function TListViewX.StringWidth(const S: WideString): Integer;
  595. begin
  596.   Result := ControlInterface.StringWidth(S);
  597. end;
  598.  
  599. procedure TListViewX.UpdateItems(FirstIndex: Integer; LastIndex: Integer);
  600. begin
  601.   ControlInterface.UpdateItems(FirstIndex, LastIndex);
  602. end;
  603.  
  604. procedure TListViewX.FlipChildren(AllLevels: WordBool);
  605. begin
  606.   ControlInterface.FlipChildren(AllLevels);
  607. end;
  608.  
  609. function TListViewX.DrawTextBiDiModeFlags(Flags: Integer): Integer;
  610. begin
  611.   Result := ControlInterface.DrawTextBiDiModeFlags(Flags);
  612. end;
  613.  
  614. function TListViewX.DrawTextBiDiModeFlagsReadingOnly: Integer;
  615. begin
  616.   Result := ControlInterface.DrawTextBiDiModeFlagsReadingOnly;
  617. end;
  618.  
  619. function TListViewX.GetControlsAlignment: TxAlignment;
  620. begin
  621.   Result := ControlInterface.GetControlsAlignment;
  622. end;
  623.  
  624. procedure TListViewX.InitiateAction;
  625. begin
  626.   ControlInterface.InitiateAction;
  627. end;
  628.  
  629. function TListViewX.IsRightToLeft: WordBool;
  630. begin
  631.   Result := ControlInterface.IsRightToLeft;
  632. end;
  633.  
  634. function TListViewX.UseRightToLeftAlignment: WordBool;
  635. begin
  636.   Result := ControlInterface.UseRightToLeftAlignment;
  637. end;
  638.  
  639. function TListViewX.UseRightToLeftReading: WordBool;
  640. begin
  641.   Result := ControlInterface.UseRightToLeftReading;
  642. end;
  643.  
  644. function TListViewX.UseRightToLeftScrollBar: WordBool;
  645. begin
  646.   Result := ControlInterface.UseRightToLeftScrollBar;
  647. end;
  648.  
  649. function TListViewX.ClassNameIs(const Name: WideString): WordBool;
  650. begin
  651.   Result := ControlInterface.ClassNameIs(Name);
  652. end;
  653.  
  654. procedure TListViewX.AboutBox;
  655. begin
  656.   ControlInterface.AboutBox;
  657. end;
  658.  
  659. class function CoListItem.Create: IListItem;
  660. begin
  661.   Result := CreateComObject(CLASS_ListItem) as IListItem;
  662. end;
  663.  
  664. class function CoListItem.CreateRemote(const MachineName: string): IListItem;
  665. begin
  666.   Result := CreateRemoteComObject(MachineName, CLASS_ListItem) as IListItem;
  667. end;
  668.  
  669. class function CoListItems.Create: IListItems;
  670. begin
  671.   Result := CreateComObject(CLASS_ListItems) as IListItems;
  672. end;
  673.  
  674. class function CoListItems.CreateRemote(const MachineName: string): IListItems;
  675. begin
  676.   Result := CreateRemoteComObject(MachineName, CLASS_ListItems) as IListItems;
  677. end;
  678.  
  679. procedure Register;
  680. begin
  681.   RegisterComponents('ActiveX',[TListViewX]);
  682. end;
  683.  
  684. end.
  685.